var mysql = require("mysql");
// 连接数据
var mysqlOptions = {
  "host":"localhost",
  "user":"root",
  "password":"",
  "database":"web1807"
}

var Client = mysql.createConnection(mysqlOptions)

function conn(sql,params,callback){
  Client.query(sql,params,function(error,result){
    if (error) {
      console.log(error)
      callback(error)
      return;
    }
    callback(result);
  })
}
module.exports = {
  conn:conn
}